package com.wlyuan.open.assembler;

import com.wlyuan.basic.dto.customer.OfflineCustomerCreationDTO;
import com.wlyuan.basic.dto.customer.OfflineCustomerUpdateDTO;
import com.wlyuan.open.basic.dto.OpenCustomerCreationDTO;
import com.wlyuan.open.basic.dto.OpenCustomerUpdateDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * @author
 * 承运商转化
 */
public class CustomerAssembler {
    @Mapper(uses = {

    })
    public interface Assembler {
        OfflineCustomerCreationDTO assemble(OpenCustomerCreationDTO openCustomer);

        OfflineCustomerUpdateDTO assemble(OpenCustomerUpdateDTO openCustomer);

    }

    private static final Assembler ASSEMBLER = Mappers.getMapper(Assembler.class);

    public static OfflineCustomerCreationDTO assemble(OpenCustomerCreationDTO openCustomer){
        return ASSEMBLER.assemble(openCustomer);
    }

    public static OfflineCustomerUpdateDTO assemble(OpenCustomerUpdateDTO updateDTO){
        return ASSEMBLER.assemble(updateDTO);
    }

}
